<?php

class Core_Backend_Component_Foundation_View_Road_Index extends Core_Backend_Share_View_Grid {
	
	protected function initialize(){
		parent::initialize();
		$this->setTemplatePath('index');
	}

    public function buildGrid($grid) {
        $this->getTemplate()->assign('users', $this->users);
        $filter = new Kd_Object($this->getRequest()->getParameter('filter'));
        $grid->setId('road_grid')
                ->setPrimaryKey('id')
                ->setSortUrlFormat($this->getSortUrl());
        $grid->addLabelColumn($this->__('share.label.code'), 'code', '{id}');
        $grid->addLabelColumn($this->__('foundation.label.road'), 'roadname', '{road_{id}}');
        $grid->setDataSource($this->getList()->toArray());
        parent::buildGrid($grid);
    }

    protected function buildPagination($pagination) {
        $pagination->setUrlFormat($this->getPaginationUrl())->setRecordCount($this->getRecords());
        parent::buildPagination($pagination);
    }

}

